<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!--360浏览器优先以webkit内核解析-->


    <title>{$Think.config.site.title} - 主页</title>

    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
	<link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Morris -->
    <link href="{$Think.config.site.resource_url}css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
    <!-- Gritter -->
    <link href="{$Think.config.site.resource_url}js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">{:lang('月')}</span>
                    <h5>{:lang('总充值额')}</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{$v.recharge}</h1>
                    <!-- <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i>
                    </div> -->
                    <small>{:lang('总充值额')}</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-info pull-right">{:lang('月')}</span>
                    <h5>{:lang('总租金额')}</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{$v.sumRent}</h1>
                    <!-- <div class="stat-percent font-bold text-info">20% <i class="fa fa-level-up"></i> 
                    </div>-->
                    <small>{:lang('总租金额')}</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-primary pull-right">{:lang('全部')}</span>
                    <h5>{:lang('总商户数')}</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{$v.sumSeller}</h1>
                    <!-- <div class="stat-percent font-bold text-navy">44% <i class="fa fa-level-up"></i>
                    </div> -->
                    <small>{:lang('总商户数')}</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-danger pull-right">{:lang('全部')}</span>
                    <h5>{:lang('总用户数')}</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{$v.sumUser}</h1>
                    <!-- <div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i> 
                    </div>-->
                    <small>{:lang('总用户数')}</small>
                </div>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('订单')}</h5>
                    <div class="pull-right">
                        <div class="btn-group">
                            
                        </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-9">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="order" style=" height:300px;" ></div>
                            </div>
                        </div>
                        <div class="col-sm-3" style=" height:300px;">
                            <ul class="stat-list" style="padding-top: 45px;">
                                <li>
                                    <h2 class="no-margins">{$v.effectiveAllOrder}</h2>
                                    <small>{:lang('订单总数')}</small>
                                    <div class="stat-percent">{$v.allOrderAvg}% <i class="fa fa-level-up text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: {$v.allOrderAvg}%;" class="progress-bar"></div>
                                    </div>
                                </li>
                                <li>
                                    <h2 class="no-margins ">{$v.monthSumOrder}</h2>
                                    <small>{:lang('最近一个月订单')}</small>
                                    <div class="stat-percent">{$v.monthOrderAvg}% <i class="fa fa-level-up text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: {$v.monthOrderAvg}%;" class="progress-bar"></div>
                                    </div>
                                </li>
                                <li>
                                    <h2 class="no-margins ">{$v.leaseSumOrder}</h2>
                                    <small>{:lang('最近一个月租借次数')}</small>
                                    <div class="stat-percent">{$v.leaseMonthAvg}% <i class="fa fa-bolt text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: {$v.leaseMonthAvg}%;" class="progress-bar"></div>
                                    </div>
                                </li>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('用户状态列表')}</h5>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover no-margins">
                        <thead>
                            <tr>
                                <th>{:lang('状态')}</th>
                                <th>{:lang('日期')}</th>
                                <th>{:lang('用户')}</th>
                                <th>{:lang('金额')}</th>
                            </tr>
                        </thead>
                        <tbody>
                        {volist name="us" id="v"}
                            <tr>
                                <td>
                                {switch name="v.status" }
                                    {case value="1"}<small>{:lang('租借中')}...</small>{/case}
                                    {case value="2"}<small><span class="label label-primary">{:lang('已完成')}</span></small>{/case}
                                    {case value="3"}<span class="label label-info">{:lang('订单超时')}</span>{/case}
                                    {case value="1"}<span class="label label-danger">{:lang('异常')}</span>{/case}
                                {/switch}    

                                </td>
                                <td><i class="fa fa-clock-o"></i> {$v.create_time|date="Y-m-d H:i",###}</td>
                                <td>{$v.name}</td>
                                <td class="text-navy"> <i class="fa fa-rmb"></i> {$v.amount}</td>
                            </tr>
                        {/volist}
                            
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="col-sm-6">
            <div class="ibox-title">
                    <h5>{:lang('当月商户交易列表')}</h5>
                </div>
            <div class="ibox-content">
                <table  class="table table-hover no-margins">
                    <thead>
                        <tr>
                            <th class="text-center">{:lang('商户名称')}</th>
                            <th>{:lang('所在区域')}</th>
                            <th class="text-center">{:lang('营业额')}</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php 
                        if(empty($st)){
                            echo '<tr><td colspan="3" style="text-align: center; color: #ff0000;">'.lang("暂无数据记录").'</td></tr>';
                        }
                    ?>
                    {volist name="st" id="v"}
                        <tr>
                            <td class="text-center">{$v.name}</td>
                            <td>{$v.area}</td>
                            <td class="text-center"><span class="label label-primary">¥{$v.amount}</span></td>
                        </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>

    </div>    




</div>
    <!-- 全局js -->
    <script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
    <script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.6"></script>
    <!-- ECharts -->
    <script src="{$Think.config.site.resource_url}js/plugins/echarts/echarts-all.js"></script>
    <!-- 自定义js -->
    <script src="{$Think.config.site.resource_url}js/content.js?v=1.0.0"></script>
    <!-- ECharts demo data -->
    <script src="{$Think.config.site.resource_url}js/demo/echarts-demo.js"></script>
<script>
if( !window.top.length){
	location.href="<?php echo \think\Request::instance()->root(); ?>/ausagent/Index/index";
};
    var  myChart = echarts.init(document.getElementById('order'));
    option = {
    noDataLoadingOption: {
        text: "{:lang('暂无数据')}",
        effect: 'bubble',
        effectOption: {
            effect: {
                n: 0
            }
        }
    },
    title : {
        text: "{:lang('本周订单详情')}",
        subtext: ''
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:["{:lang('本周租金额')}"]
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : [{volist name="wrant" id="v"}'{$v.unit} 日', {/volist}]
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:"{:lang('本周租金额')}",
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:[{volist name="wrant" id="v"}{$v.amount},{/volist}]
        }
        
    ]
};
 myChart.setOption(option);
</script>
</body>

</html>